package com.clown.activeMq;

import javax.jms.Destination;

import org.apache.activemq.command.ActiveMQQueue;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import com.clown.run.Start;

/**
 * 测试activeMq
 * 
 * @author CJ
 * @since 2017年10月26日
 * @version 1.0
 */
@RunWith(SpringRunner.class)  
@SpringBootTest(classes = Start.class)
public class SpringbootJmsApplicationTests {

	@Autowired
	private Producer producer;

	@Test
	public void contextLoads() throws InterruptedException {
		Destination destination = new ActiveMQQueue("mytest.queue");

		for (int i = 0; i < 100; i++) {
			producer.sendMessage(destination, "myname is chhliu!!!");
		}
	}

}
